# -*- coding:utf-8 -*-
import sys
import pygame
from pygame import display
from pygame.locals import *
clock = pygame.time.Clock()
pygame.init()
size = width, height = 500,650
screen = pygame.display.set_mode(size)
plane = pygame.image.load('plane.png')
Y = 325
x = 250
while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            sys.exit()
        if event.type == KEYDOWN and event.key == K_LEFT:
            if x != 0:
                print('a')
                x -= 10
        if event.type == pygame.K_RIGHT:
            if x != 500:
                print('a')
                x += 10
    screen.fill((81,129,203))
    screen.blit(plane,(x,Y))
    clock.tick(60)
    display.flip()
    # print('a')
pygame.quit()